home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Varios Español
/
Varios Español.iso
/
PMAKER65
/
archive.z
/
DIVIDIR ARTICULO.SPT
< prev
next >
Wrap
Text File
|
1997-01-14
|
3KB
|
141 lines
-- Split Story
-- 10 November 96, vsamarsk
-- Este gui≤n destruye el enlace entre dos
-- bloques de texto. Debe seleccionar los dos
-- bloques de texto antes de ejecutar el gui≤n.
-- (Precauci≤n: Si los bloques de texto contienen orφgenes de
-- hiperenlaces o anclas, puede que este gui≤n los traslade
-- a un lugar inesperado.)
getpagenumber => pn0
getselectidlist => N,id1,...,...,...,t1,....,....,....,....,...,...,...,...,...,...,id2,...,...,...,t2,...
if not(t1,t2=1,1)
message "Estado invßlido para gui≤n solicitado."
return
endif
selectid id1
textedit
gettextcursor => ...,c1,...
deselect
selectid id2
textedit
gettextcursor => ...,c2,...
deselect
if c2<c1
set id1,id2=>id2,id1
endif
rem check that 2 consequtive textblocks are selected
selectid id1
textedit
textcursor +textblock
textcursor +char
gettextlocation => L,...
if not(L=id2)
message "Estado no vßlido."
return
endif
selectid id2
textedit
gettextcursor =>storyId,begin,...
selectall
gettextcursor => ...,...,end
settextcursor -2,begin,end
copy
settextcursor -2,begin,begin
gettextlocation => sourceId,...
deselect;selectid sourceId
gettransform => x
getobjectloc lefttop => xLT,yLT
getobjectloc righttop => xRT,yRT
getobjectloc rightbottom => xRB,yRB
getobjectloc leftbottom => xLB,yLB
newstorysized min(xLT,xRT,xRB,xLB),min(yLT,yRT,yRB,yLB),max(xLT,xRT,xRB,xLB),max(yLT,yRT,yRB,yLB)
paste
textcursor -story
gettextlocation => destId,...
deselect;selectid destId
gosub settrans.f,x
getpagenumber => pn
set destId => destId.sav
repeat
selectid sourceId
textedit
textcursor +textblock
textcursor +char
gettextcursor => tc
if not(tc(3)=end)
try settextcursor tc
endif
try gettextlocation=>sourceId.next,...
if (sourceId.next=sourceId)+empty(sourceId.next)
break
endif
set sourceId.next=>sourceId
selectid sourceId
gettransform => x
getobjectloc lefttop => xLT,yLT
getobjectloc righttop => xRT,yRT
getobjectloc rightbottom => xRB,yRB
getobjectloc leftbottom => xLB,yLB
getpagenumber => pn.next
page pn
selectid destId
try placenext bottom
getlasterror => err
if err
break
endif
rem now as textgun loaded return on the page where textblock should be placed
page pn.next
rem place new text to the bounding box of the old textblock
rem to be sure that it wont fall of pasteboard
placesized min(xLT,xRT,xRB,xLB),min(yLT,yRT,yRB,yLB),max(xLT,xRT,xRB,xLB),max(yLT,yRT,yRB,yLB)
rem now refine it
gosub settrans.f,x
getselectidlist => ...,destId,...
set pn.next => pn
until 0
settextcursor storyId,begin,end
clear
deselect
selectid id1
selectidextend destId.sav
return
///////////////
sub settrans.f
getprocparam => ...,transform
getpagerect => page.lefttop.x, page.lefttop.y, page.rightbottom.x, page.rightbottom.y
set (page.lefttop.x+page.rightbottom.x)/2,(page.lefttop.y+page.rightbottom.y)/2=>page.center.x,page.center.y
set transform => rot,skew,refl,xlt,ylt,xrb,yrb,xLT,yLT,xRT,yRT,xRB,yRB,xLB,yLB
set (xlt+xrb)/2=>xc
set (ylt+yrb)/2=>yc
set xlt-xc,ylt-yc,xrb-xc,yrb-yc=>xlt,ylt,xrb,yrb
gettransform => ...,...,r,...
rotate center,0
skew center,0
if r
reflect center,vertical
endif
move lefttop,xlt+page.center.x,ylt+page.center.y
resize rightbottom,xrb+page.center.x,yrb+page.center.y
if refl
reflect center,vertical
endif
rotate center,rot
skew center,skew
move lefttop,xLT,yLT
resize rightbottom,xRB,yRB
endsub